package com.timothy.asset.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by IntelliJ IDEA.
 * User: qtang
 * Date: 2011-11-23
 * Time: 13:24:27
 * To change this template use File | Settings | File Templates.
 */
public class PropertiesUtil {
    private Properties properties;

    public PropertiesUtil(String fileName) {
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(fileName);
        properties = new Properties();
        try {
            properties.load(inputStream);
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }

    public String getValue(String key){
        return properties.getProperty(key);
    }

    public static void main(String[] args) {
        PropertiesUtil pu = new PropertiesUtil("config.properties");
        System.out.println(pu.getValue("YingHuangWenJin_Code"));
    }
}
